import React from 'react'
import { connect } from 'react-redux'
import { NestedRoute } from '@/router'
import Header from '@/components/Header/Header'
import './index.scss'
function Space(props) {
    const { router } = props
    return (
        <div className="space">
            <div className="space-top">
                <Header />
            </div>
            <img src={require('../../assets/images/banner-top.png')} alt="" className="space-pic" />
            {router.map((route, i) => (
                <NestedRoute {...route} key={i} />
            ))}
        </div>
    )
}

export default connect(
    function mapStateToProps(state) {
        return state
    },
    function mapDispatchToProps(dispatch) {
        return { dispatch }
    }
)(Space)
